package saa.model.usuario;

import java.util.List;

import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;

import saa.model.Curso;
import saa.model.periodo.aluno.OfertaDisciplinaAluno;

@Entity
@NamedQueries({
		@NamedQuery(name = "Aluno.findById", query = "SELECT a FROM Aluno a WHERE a.id = :id"),
		@NamedQuery(name = "Aluno.findAll", query = "SELECT a FROM Aluno a"),
		@NamedQuery(name = "Aluno.findByLogin", query = "SELECT a FROM Aluno a WHERE a.login = :login"), })
public class Aluno extends Usuario {

	private static final long serialVersionUID = 1L;

	public Aluno() {
		super();
	}

	public Aluno(String nome, String login, String senha) {
		super(nome, login, senha);
	}

	@ManyToOne
	private Curso curso;

	@OneToMany(mappedBy = "aluno")
	private List<OfertaDisciplinaAluno> disciplinas;

	public Curso getCurso() {
		return curso;
	}

	public void setCurso(Curso curso) {
		this.curso = curso;
	}

	public List<OfertaDisciplinaAluno> getDisciplinas() {
		return disciplinas;
	}

	public void setDisciplinas(List<OfertaDisciplinaAluno> disciplinas) {
		this.disciplinas = disciplinas;
	}

}
